Heterogeneity is a ubiquitous feature of biological systems. A complete understanding of such systems requires a method for uniquely identifying and tracking individual components and their interactions with each other. We have developed a novel method of uniquely tagging individual cells in vivo with a genetic 'barcode' that can be recovered by DNA sequencing. We demonstrate the feasibility of this technique in bacterial cells. This method should prove useful in tracking interactions of cells within a network, and/or heterogeneity within complex biological samples.